<?php defined('ByShopWWI') or exit('Access Invalid!');?>
<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"  />

<div class="wrap">
  <div class="tabmenu">
    <?php include template('layout/submenu');?>
  </div>
  <div class="alert alert-block">
  <h4>宝豆获得及使用规则</h4>
<ul>
<!--修改<li>成功注册会员：增加<em><?php echo C('points_reg');?></em>积分；会员每天登录：增加<em><?php echo C('points_login');?></em>积分；评价完成订单：增加<em><?php echo C('points_comments');?></em>积分。</li>
<?php if (C('points_orderrate')) {?>
<li>购物并付款成功后将获得订单总价的积分，积分比例1元：100个积分。</li><?php }?>
<li>如订单发生退款、退货等问题时，系统后台将冻结您的账号，积便扣除积分你所你说产生的积分和余额现金。</li> 
<li>◇ 线下购物：顾客首先注册成为宝凯俪德商城会员，交易成功后，宝凯俪德商城联盟商家将在48小时内，将赠送的宝豆转入顾客个人账户，积分比例1元=100宝豆。</li>
<li>◇ 线上购物：顾客确认收货后，将获得宝凯俪德商城赠送的订单总价的宝豆，积分比例1元=100宝豆。</li>
<li>◇ 线上购物如产生退款、退货等交易纠纷，经宝凯俪德商城审核落实责任，将给予积分扣除、已转化余额扣除直至冻结账户的处理。</li>
<li>◇ 宝豆总额不低于10000时参与赠与返还，参与赠与返还的宝豆自动转化为分红豆，同时宝豆自动扣除等同数量。</li>-->
</ul>
<style>
    .redpoints{width:98%; height:40px; margin-top:20px; padding:0px; border-bottom:1px solid #f2efe9; overflow:hidden; text-align:center} 
	.redpoints ul {list-style:none; margin:0px; padding:0px;}
	.redpoints ul li { color:#3b97d3; font-size:14px;list-style:none; margin:0px; padding:0px; float:left; line-height:30px}
  </style>
  </div>
  <div class="redpoints">
  <ul>
  <form method="get" action="/puhui/consume.php">
      <li>我的可用宝豆：<strong style="color: #F00;"><?php $m_r_p = $output['member_info']['member_points']; echo $m_r_p;?></strong>&nbsp;&nbsp;最多可兑换&nbsp;<strong style="color: #F00;"><?php echo $m_r_p/100;?></strong>。&nbsp;&nbsp</li>
      <li>我要兑换：<input type="hidden" name='member' value="<?php echo $m_r_p = $output['member_info']['member_id']?>">
      <li><?php 
           $m_r_pqz = floor($m_r_p/100)*100;
           if ($m_r_pqz <= 0 ) {
			  $m_r_pqz=0;
		   }
           ?><input type="text" name="red_points"/></li>
      <li><input type="submit" name="button" id="button" value="宝豆转换消费豆" /></form> 友情提示：比例为2：1</li>
      
      </form>
   </ul>
   </div>
  <form method="get" action="index.php">
    <table class="ncm-search-table">
      <input type="hidden" name="act" value="member_points" />
      <tr><td class="w10">&nbsp;</td>
        <td><strong><?php echo $lang['points_log_pointscount']; ?></strong><strong style="color: #F00;"><?php echo $output['member_info']['member_points']; ?></strong>&nbsp;&nbsp;<?php echo $lang['points_log_pointscount_reds']; ?><strong style="color: #F00;"><?php echo  $output['member_info']['member_red_points']; ?></strong></td>
        <th><?php echo $lang['points_addtime'] ?></th>
        <td class="w240"><input type="text" id="stime" name="stime" class="text w70" value="<?php echo $_GET['stime'];?>"><label class="add-on"><i class="icon-calendar"></i></label>&nbsp;&#8211;&nbsp;<input type="text" id="etime" name="etime" class="text w70" value="<?php echo $_GET['etime'];?>"><label class="add-on"><i class="icon-calendar"></i></label></td>
       
        <th><?php echo $lang['points_pointsdesc']; ?></th>
        <td class="w160"><input type="text" class="text w150" id="description" name="description" value="<?php echo $_GET['description'];?>"></td>
        <td class="w70 tc"><label class="submit-border">
            <input type="submit" class="submit" value="<?php echo $lang['nc_search'];?>" />
          </label></td>
      </tr>
    </table>
  </form>
  <table class="ncm-default-table">
    <thead>
      <tr>
        <th class="w200"><?php echo $lang['points_addtime']; ?></th>
        <th class="w150"><?php echo $lang['points_pointsnum']; ?></th>
        <th class="w300"><?php echo $lang['points_stage']; ?></th>
        <th class="tl"><?php echo $lang['points_pointsdesc']; ?></th>
      </tr>
    </thead>
    <tbody>
      <?php  if (count($output['list_log'])>0) { ?>
      <?php foreach($output['list_log'] as $val) { ?>
      <tr class="bd-line">
        <td class="goods-time"><?php echo date('Y-m-d H:i:s',$val['pl_addtime']);?></td>
        <td class="goods-price"><?php echo ($val['pl_points'] > 0 ? '+' : '').$val['pl_points']; ?></td>
        <td><?php 
	              	switch ($val['pl_stage']){
	              		case 'regist':
	              			echo $lang['points_stage_regist'];
	              			break;
	              		case 'login':
	              			echo $lang['points_stage_login'];
	              			break;
	              		case 'comments':
	              			echo $lang['points_stage_comments'];
	              			break;
	              		case 'order':
	              			echo $lang['points_stage_order'];
	              			break;
	              		case 'system':
	              			echo $lang['points_stage_system'];
	              			break;
	              		case 'pointorder':
	              			echo $lang['points_stage_pointorder'];
	              			break;
	              		case 'app':
	              			echo $lang['points_stage_app'];
	              			break;
	              	}
	              ?></td>
        <td class="tl"><?php echo $val['pl_desc'];?></td>
      </tr>
      <?php } ?>
      <?php } else { ?>
      <tr>
        <td colspan="20" class="norecord"><div class="warning-option"><i>&nbsp;</i><span><?php echo $lang['no_record']; ?></span></div></td>
      </tr>
      <?php } ?>
    </tbody>
    <tfoot>
      <?php  if (count($output['list_log'])>0) { ?>
      <tr>
        <td colspan="20"><div class="pagination"><?php echo $output['show_page']; ?></div></td>
      </tr>
      <?php } ?>
    </tfoot>
  </table>
</div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script> 
<script language="javascript">
$(function(){
	$('#stime').datepicker({dateFormat: 'yy-mm-dd'});
	$('#etime').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>